package br.ufu.lsi.social.storage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import br.ufu.lsi.social.storage.loader.TwitterLoader;

@Controller
public class LoaderController {

    @Autowired
    TwitterLoader loader;
    
    @RequestMapping( value = "/load/{userId}", method = RequestMethod.GET)
    @ResponseBody
    public String load( @PathVariable( "userId" ) long userId ) {
        loader.loadFollowersFile( userId );
        
        return "Ok";
    }
}
